<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">

    <title></title>
    <style>
     /*   #parent {
            width: 500px;
            background: #ff2133;
        }*/

        #son{
            width: 100px; /*必须定宽*/
            margin: 0 auto;
            background: #34ff2e;
        }
    </style>
</head>
<body>

<div id="parent">
           <div id="son">
               儿子
           </div>
</div>
</body>
</html>